package cn.doitedu.day04.demo

import cn.doitedu.day01.utils.SparkUtil

/**
 * @Date 22.4.1
 * @Created by HANGGE
 * @Description
 */
object Wc02 {
  def main(args: Array[String]): Unit = {
    SparkUtil
      .getSc
      .textFile("data/a.txt")
      .flatMap(_.split("\\s+"))
      .map((_,1))
      .groupByKey()
      .map(tp=>{
        (tp._1 , tp._2.toList.size)
      }).foreach(println)
  }


}
